package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.AjaxResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TNucleateBuildingTaskMapper;
import com.ruoyi.system.domain.TNucleateBuildingTask;
import com.ruoyi.system.service.ITNucleateBuildingTaskService;

/**
 * 核酸楼栋任务Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-10-16
 */
@Slf4j
@Service
public class TNucleateBuildingTaskServiceImpl implements ITNucleateBuildingTaskService 
{
    @Autowired
    private TNucleateBuildingTaskMapper tNucleateBuildingTaskMapper;

    /**
     * 查询核酸楼栋任务
     * 
     * @param id 核酸楼栋任务主键
     * @return 核酸楼栋任务
     */
    @Override
    public TNucleateBuildingTask selectTNucleateBuildingTaskById(Long id)
    {
        return tNucleateBuildingTaskMapper.selectTNucleateBuildingTaskById(id);
    }

    /**
     * 查询核酸楼栋任务列表
     * 
     * @param tNucleateBuildingTask 核酸楼栋任务
     * @return 核酸楼栋任务
     */
    @Override
    public List<TNucleateBuildingTask> selectTNucleateBuildingTaskList(TNucleateBuildingTask tNucleateBuildingTask)
    {
        return tNucleateBuildingTaskMapper.selectTNucleateBuildingTaskList(tNucleateBuildingTask);
    }

    /**
     * 新增核酸楼栋任务
     * 
     * @param tNucleateBuildingTask 核酸楼栋任务
     * @return 结果
     */
    @Override
    public int insertTNucleateBuildingTask(TNucleateBuildingTask tNucleateBuildingTask)
    {
        return tNucleateBuildingTaskMapper.insertTNucleateBuildingTask(tNucleateBuildingTask);
    }

    /**
     * 修改核酸楼栋任务
     * 
     * @param tNucleateBuildingTask 核酸楼栋任务
     * @return 结果
     */
    @Override
    public int updateTNucleateBuildingTask(TNucleateBuildingTask tNucleateBuildingTask)
    {
        return tNucleateBuildingTaskMapper.updateTNucleateBuildingTask(tNucleateBuildingTask);
    }

    /**
     * 批量删除核酸楼栋任务
     * 
     * @param ids 需要删除的核酸楼栋任务主键
     * @return 结果
     */
    @Override
    public int deleteTNucleateBuildingTaskByIds(Long[] ids)
    {
        return tNucleateBuildingTaskMapper.deleteTNucleateBuildingTaskByIds(ids);
    }

    /**
     * 删除核酸楼栋任务信息
     * 
     * @param id 核酸楼栋任务主键
     * @return 结果
     */
    @Override
    public int deleteTNucleateBuildingTaskById(Long id)
    {
        return tNucleateBuildingTaskMapper.deleteTNucleateBuildingTaskById(id);
    }

    // 短信消息
    @Override
    public AjaxResult sendMsg(Long id) {
        TNucleateBuildingTask tNucleateBuildingTask = tNucleateBuildingTaskMapper.selectTNucleateBuildingTaskById(id);
        log.info("你的核酸任务将" + tNucleateBuildingTask.getStartTime()+"开始，尽快去做核酸检测");
        return AjaxResult.success();
    }


}
